<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
    <style>
      .box {
        width: 150px;
        height: 150px;
        background-color: pink;
        margin: 100px auto;
        transition: all 0.5s;
      }

      .current {
        background-color: red;
        transform: rotate(360deg);
      }
    </style>
    <script src="./js/jquery1.42.min.js"></script>
  </head>

  <body>
    <div class="box"></div>
    <button id="add">添加类名</button>
    <button id="remove">移除类名</button>
    <button id="toggle">切换类名</button>
    <script>
      $("#add").click(function () {
        $(".box").addClass("current");
      });

      $("#remove").click(function () {
        $(".box").removeClass("current");
      });

      $("#toggle").click(function () {
        $(".box").toggleClass("current");
      });
    </script>
  </body>
</html>
